package com.bjtang.web;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.bjtang.test.User;
import com.bjtang.util.MapList;

@RestController
@ComponentScan
public class TestController {

	/**
	 * 请求示例 http://127.0.0.1:8080/in
	 */

	// 进入列表
	@GetMapping("/in")
	public  List<User> in(HttpServletResponse res) {
		res.addHeader("Access-Control-Allow-Origin", "*");
		return 	MapList.getInstance().getInUserList();
	}

	

	// 出去列表
	@GetMapping("/out")
	public List<User> out(HttpServletResponse res) {
		res.addHeader("Access-Control-Allow-Origin", "*");
		return 	MapList.getInstance().getOutUserList();
	}
	
	
	
}
